<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="http://mat1.gtimg.com/libs/jquery/1.12.0/jquery.js"></script>
</head>
<body>
<h1>欢迎{{ request.session.user }},登录</h1>
<button value="1" name="b">退出登录</button>
<table>
    {% for alls in all %}
        <tr>
        <td>{{ forloop.counter }}</td>
        <td>{{ alls.tit }}</td>
        <td>{{ alls.ath }}</td>
        <td>{{ alls.cont }}</td>
        <td>{{ alls.dat }}</td>
        <td>{% if alls.ns == 1 %}
            已审核
            {% else %}
            未审核
        {% endif %} </td>
        <td>{{ alls.NewsType.tname }}</td>
        <td><a href="{% url 'delete' id=alls.id %}" onclick="s()">删除</a></td>
        </tr>
    {% endfor %}
    <tr><td><a href="{% url 'add' %}">添加</a></td></tr>
    <script>
        function s() {
            alert('删除成功')
        }
    </script>
</table>
</body>
</html>